<?php
/*
 * Created on 23 sept. 2010
 * Created by Ludovic Reenaers
 * lreenaers@hotmail.com
 */
class ViewCategory extends View{
	function show($bean){
		$page='<div id="inMain"><h1>Title</h1><div class="contenu">';
		$page.='hello';


		$page.="<h3>Categories:</h3>";
		$page.="<ul>";
		foreach ($bean->getChildCategories() as $cat){
			$label = $cat->getLabel($_SESSION['langue']);
			$tooltip = $cat->getTooltip($_SESSION['langue']);
			$page.='<li><a href="'.$_SESSION['config']->controler.'?/category/show/'.$cat->getId().'/'.$label.'/" alt="'.$tooltip.'" title="'.$tooltip.'">'.$label.'</a></li>';
		}
		$page.="</ul>";
		$page.="<h3>Documents:</h3>";
		$page.="<ul>";
		foreach ($bean->getChildDocuments() as $doc){
			$label = $doc->getInfo($_SESSION['langue']);
			$tooltip = $doc->getTooltip($_SESSION['langue']);
			$page.='<li><a href="'.$_SESSION['config']->controler.'?/document/show/'.$doc->getId().'/'.$label.'/" title="'.$tooltip.'" alt="'.$tooltip.'">'.$label.'</a></li>';
		}
		$page.="</ul>";
		$page.='</div></div>';
		$this->setContent($page);
	}
}
?>
